package com.foreknow.elm.controller;

import com.foreknow.elm.po.Business;
import com.foreknow.elm.service.BusinessService;
import com.foreknow.elm.service.impl.BusinessServiceImpl;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

public class BusinessController {

    public Object listBusinessByOrderTypeId(HttpServletRequest request){
        //  BusinessController/listBusinessByOrderTypeId?orderTypeId=1
        //获取前台的请求参数
        Integer orderTypeId = Integer.parseInt(request.getParameter("orderTypeId"));
        BusinessService businessService = new BusinessServiceImpl();
        List<Business> list = businessService.listBusinessByOrderTypeId(orderTypeId);
        return list;
    }
    //  BusinessController/getBusinessId?businessId=10006
    public Business getBusinessId(HttpServletRequest request){
        Integer businessId = Integer.parseInt(request.getParameter("businessId"));
        BusinessService businessService = new BusinessServiceImpl();
        Business business = businessService.getBusinessId(businessId);
        return business;
    }
}
